import { ManagerOptions, SocketOptions } from "socket.io-client";

type IoOptions = Partial<ManagerOptions & SocketOptions>;

export const getIoUrl = () =>
    process.env.REACT_APP_SIGNAL_URL || 'http://localhost:4001';

export const getIoOptions = (): IoOptions => ({
    forceNew: true,
    reconnectionAttempts: Infinity,
    timeout: 10000,
    transports: ['websocket'],
    withCredentials: true,
    // autoConnect: false,
});
